#include <stdio.h>

int gcd(int a, int b) {
    while (b) {
        int t = a % b;
        a = b;
        b = t;
    }
    return a;
}

int main() {
    int a1, b1, a2, b2;
    scanf("%d/%d %d/%d", &a1, &b1, &a2, &b2);
    int num = a1 * b2 + a2 * b1;
    int den = b1 * b2;
    int g = gcd(num, den);
    num /= g;
    den /= g;
    if (den == 1)
        printf("%d\n", num);
    else
        printf("%d/%d\n", num, den);
    return 0;
}
